package com.mayi.zds_comment.dao;

import com.mayi.zds_comment.entity.BusinessCategory;
import org.apache.ibatis.annotations.*;

import java.util.List;


/**
 * 用于商户类别的Dao接口
 */
public interface BusinessCategoryDao {
    /**
     * 添加商户类别 商户类别实例
     * @param businessCategory
     */
    @Insert("insert into ds_business_category values(#{id},#{name},#{parentId},#{businessCount},#{status})")
    public void add(BusinessCategory businessCategory);

    /**
     * 用于处理商户类别删除的Dao方法
     * @param id 主键
     */
    @Delete("delete from ds_business_category where id=#{id}")
    public void delete(String id);

    /**
     * 用于查询商户类别 （展示）的DAo方法
     * @return 返回查询到的所有商户
     */
    @Select("select * from  ds_business_category ")
    @Results(value = {@Result(property = "parentId",column = "parent_id"),
    @Result(property = "businessCount",column = "business_count")})
    public List<BusinessCategory> getAll();
}



